﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.TeamFoundation.VersionControl.Client;
using System.Windows;
using System.Windows.Media;

namespace SmallTfs
{
    public class DisplayItem
    {
        private ExtendedItem current;


        public string ServerItem
        {
            get
            {
                return current.SourceServerItem;
            }
        }
        public DateTime CheckinDate
        {

            get
            {

                return current.CheckinDate;
            }
        }

        public Visibility IsCheckedOut
        {
            get
            {
                if (String.IsNullOrEmpty(CheckOutOwner))
                    return Visibility.Visible;
                else
                    return Visibility.Collapsed;

            }

        }

        public SolidColorBrush IsCheckOutColor
        {
            get
            {
                if (String.IsNullOrEmpty(CheckOutOwner))
                    return new SolidColorBrush(Colors.Black);
                else
                    return  new SolidColorBrush(Colors.Red);

            }


        }


        public Visibility IsNotCheckedOut
        {
            get
            {
                if (String.IsNullOrEmpty(CheckOutOwner))
                    return Visibility.Collapsed;
                else
                    return Visibility.Visible;

            }
        }

        
        public string CheckOutOwner { get; set; }
        public string CheckOutComputer{ get; set; }




        public DisplayItem(ExtendedItem _current ,string checkoutOwner, string checoutComputer)
        {
            current = _current;
            CheckOutOwner = checkoutOwner;
            CheckOutComputer = checoutComputer;
        }
    }
}
